<?php


namespace app\model;


use think\Model;
use think\model\concern\SoftDelete;

class Post extends Model
{
    use SoftDelete;
    protected $deleteTime = 'deleteTime';
    protected $hidden =['deleteTime'];

    public function  oneContent()
    {
        return $this->hasOne(Info::class, 'post_id', 'id')
            ->order('createTime', 'asc');
    }
    public function  info()
    {
        return $this->hasMany(Info::class, 'post_id', 'id');
    }
    public function userInfo(){
        return $this->hasOne(User::class ,'id' , 'user_id');
    }
}